<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page session="true" %>
<%@ page import="javax.portlet.*"%>
<%@ page import="pits.dto.PreSearchDTO" %>
<%@ page import="pits.dao.SearchInfoDAO" %>
<%@ page import="pits.dto.EmployeeDTO" %>
<%@ page import="java.util.List" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<portlet:defineObjects />

<html>

<script>
	var comSelected = 0;
	var courseComSelected = 0;
	var courseDepSelected = 0;
	var projectComSelected = 0;
	var projectDepSelected = 0;

	function isNumber(input) {
		for (i = 0; i < input.length; i++) {
			if (input.charAt(i) < '0' || input.charAt(i) > '9') {
				return false;
			}
		}
		return true;
	}

	function isIn(container, str, splitter) {
		var arr = container.split(splitter);
		for (i = 0; i < arr.length; i++) {
			if (arr[i] == str) return true;
		}
		return false; 
	}
	
	function getForm(namespace, name) {
		return document.forms[namespace + name];
	}

	function MOEFieldsOK(namespace, name) {
		frm = getForm(namespace, name);
		tmp = frm.langMOE.value.split(':');
		for (i = 0; i < tmp.length; i++) {
			if (!isNumber(tmp[i])) return false;
		}
		tmp = frm.appMOE.value.split(':');
		for (i = 0; i < tmp.length; i++) {
			if (!isNumber(tmp[i])) return false;
		}
		tmp = frm.techMOE.value.split(':');
		for (i = 0; i < tmp.length; i++) {
			if (!isNumber(tmp[i])) return false;
		}
		tmp = frm.frameMOE.value.split(':');
		for (i = 0; i < tmp.length; i++) {
			if (!isNumber(tmp[i])) return false;
		}
		return true;
	}

	function resetTechnology(namespace, name) {
		frm = getForm(namespace, name);
		
		frm.selectLang.selectedIndex = 0;
		frm.language.value = 'All';
		frm.txtLang.value = '';
		frm.langExp.value = '';
		frm.langMOE.value = '';
		
		frm.selectApp.selectedIndex = 0;
		frm.application.value = 'All';
		frm.txtApp.value = '';
		frm.appExp.value = '';
		frm.appMOE.value = '';

		frm.selectTech.selectedIndex = 0;
		frm.technology.value = 'All';
		frm.txtTech.value = '';
		frm.techExp.value = '';
		frm.techMOE.value = '';
		
		frm.selectFrame.selectedIndex = 0;
		frm.framework.value = 'All';
		frm.txtFrame.value = '';
		frm.frameExp.value = '';
		frm.frameMOE.value = '';
	}
	
	function submitForm(namespace, name, action) {
		var frm = getForm(namespace, name);
		frm.txtAction.value = action;
		frm.submitLink.value = "SearchInfo.jsp";
		//document.write(frm.language.value);
		frm.submit();
		//printall(frm);
		//alert("done");
	}

	function printall(frm) {
		document.write(frm.employeeName.value + "<br>" +
						frm.companyID.value + "<br>" +
						frm.departmentID.value + "<br>" +
						frm.courseCom.value + "<br>" +
						frm.courseDep.value + "<br>" +
						frm.courseID.value + "<br>" +
						frm.grade.value + "<br>" +
						frm.projectCom.value + "<br>" +
						frm.projectDep.value + "<br>" +
						frm.projectID.value + "<br>" +
						frm.language.value + "<br>" +
						frm.langMOE.value + "<br>" +
						frm.application.value + "<br>" +
						frm.appMOE.value + "<br>" +
						frm.technology.value + "<br>" +
						frm.techMOE.value + "<br>" +
						frm.framework.value + "<br>" +
						frm.frameMOE.value
		);
	}
</script>

<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>Personal Information Tracking System</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	
	<script type="text/javascript" src='<%=renderRequest.getContextPath() + "/js/simpletreemenu.js" %>' ></script>
	<link rel="stylesheet" type="text/css" href='<%=renderRequest.getContextPath() + "/style/simpletree.css" %>' />
	
	<script type="text/javascript" src='<%=renderRequest.getContextPath() + "/js/calendarDateInput.js" %>' ></script>
	
	<link href='<%=renderRequest.getContextPath() + "/style/style.css" %>' rel="stylesheet" type="text/css" media="screen" />
</head>

<body>
<form name="<portlet:namespace/>myForm" action="<portlet:actionURL/>" method="POST">
<input type="hidden" name="txtAction"/>
<input type="hidden" name="submitLink"/>
<p align="right">
	You are logging in as 
	<a href="#" onclick="submitForm('<portlet:namespace/>', 'myForm', 'getEmployeeInfo')"><b>${sessionScope.userName}</b></a>
	! &nbsp;
	<a href="#" onclick="submitForm('<portlet:namespace/>', 'myForm', 'home')">Home</a>
	| &nbsp;
	<a href="#" onclick="submitForm('<portlet:namespace/>', 'myForm', 'logout')">Logout</a>
</p>
</form>
<form name="<portlet:namespace/>searchForm" action="<portlet:actionURL/>" method="POST">
	<input type="hidden" name="txtAction" />
	<input type="hidden" name="submitLink" />
	<input type="hidden" name="selectedSearchEmp" />
	<input type="hidden" name="exportEmpList" />
	<%
	PreSearchDTO preSearchData = new SearchInfoDAO().getData();
	%>
	<table>

		<tr class="title">
			<td colspan="2">
				<img src='<%=renderRequest.getContextPath() + "/img/HCMUTLogo.jpg" %>' />
				<h1><a href="#">Personal information tracking system </a></h1>
				<p>exploit the value of data</p>
				<hr />
			</td>
		</tr>
		
		<tr>
			<td style="vertical-align:text-top">
				<table border="1">
					<tr>
						<td>
							<table border="1">
								<tr>
									<td><h2 class="title">Search Employee	 Information</h2></td>
								</tr>
								
								<tr>
									<td>
										<table border="1" width="100%">
											<tr>
												<td align="left" valign="bottom">&nbsp;Employee Name&nbsp;</td>
												<td align="left" valign="middle" colspan="3"><input type="text" name="employeeName" value=""/></td>
											</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Company&nbsp;</td>
												<td align="left" valign="middle">
													<select name="companyID" id="comSelect" onchange="
														if (comSelected != 0) {
															document.getElementById('depDiv' + comSelected).style.display='none';
														}
														document.getElementById('depDiv' + this.selectedIndex).style.display = 'inline';
														comSelected = this.selectedIndex;
														document.getElementById('dep' + this.selectedIndex).selectedIndex = 0;
														this.form.departmentID.value = document.getElementById('dep' + this.selectedIndex).options[0].value;
													">
														<option value="All">All</option>
													<%
													for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
													%>
														<option value=<%=preSearchData.getCompanyIDs().get(i).intValue() %> ><%=preSearchData.getCompanyNames().get(i) %></option>
													<%
													}
													%>
													</select>
												</td>
												<td colspan="2" align="left" valign="middle">Department
													<input type="hidden" name="departmentID" value="<%=preSearchData.getDepartIDs().get(0).get(0) %>" />
													<%
													for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
													%>
														<div id='<%="depDiv" + (i + 1) %>' style='<%="position:relative; display:none" %>'>
														<select id='<%="dep" + (i + 1) %>' onchange="
															this.form.departmentID.value = this.value;
														">
															<option value="All">All</option>
													<%
														for (int j = 0; j < preSearchData.getDepartNames().get(i).size(); j++) {
													%>
															<option value=<%=preSearchData.getDepartIDs().get(i).get(j) %> ><%=preSearchData.getDepartNames().get(i).get(j) %></option>
													<%
														}
													%>
														</select>
														</div>
													<%
													}
													%>
												</td>
											</tr>
											
<!-------------------------------Course Information Part------------------------------------------------------------------------------------------------------------------------------->
											
											<tr>
							  					<td align="left" valign="bottom" colspan="4">
							  						<input name="courseID" type="hidden" value="
							  							<%
							  							if (preSearchData.getCourseIDs().size() > 0) {
							  								if (preSearchData.getCourseIDs().get(0).size() > 0) {
							  									if (preSearchData.getCourseIDs().get(0).get(0).size() > 0) {
						  										%>
									  								<%=preSearchData.getCourseIDs().get(0).get(0).get(0) %>
									  							<%
							  									}
							  									else {
						  										%>
									  								<%=""%>
									  							<%
							  									}
							  								}
							  								else {
						  									%>
								  								<%=""%>
								  							<%
							  								}
							  							}
							  							else {
							  							%>
							  								<%=""%>
							  							<%
							  							}
							  							%>
							  						"/>
							  						<em>&nbsp;Course Information&nbsp;</em>
							  					</td>
							  				</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Department/Institute Issued &nbsp;</td>
												<td align="left" valign="middle">
													<input type="hidden" name="courseDep" value="All" />
													<select name="courseCom" onchange="
														if (courseComSelected != 0) {
															document.getElementById('courseDepDiv' + courseComSelected).style.display = 'none';
															if (courseDepSelected != 0) {
																document.getElementById('courseDiv' + courseComSelected + ':' + courseDepSelected).style.display = 'none';
															}
														}
														
														courseComSelected = this.selectedIndex;
														courseDepSelected = 0;
														
														document.getElementById('courseDepDiv' + this.selectedIndex).style.display = 'inline';
														document.getElementById('courseDep' + this.selectedIndex).selectedIndex = 0;
														
														this.form.courseDep.value = 'All';
														
														document.getElementById('courseDiv' + this.selectedIndex + ':' + 0).style.display = 'inline';
														document.getElementById('course' + this.selectedIndex + ':' + 0).selectedIndex = 0;
														
														this.form.courseID.value = 'All';
													">
															<option value="All">All</option>
														<%
														for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
														%>
															<option value=<%=preSearchData.getCompanyIDs().get(i).intValue() %> ><%=preSearchData.getCompanyNames().get(i) %></option>
														<%
														}
														%>
													</select>
												</td>
												<td colspan="2" align="left" valign="middle">Department
													<%
													for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
													%>
														<div id='<%="courseDepDiv" + (i + 1)%>' style='<%="position:relative; display:none" %>'>
														<select id='<%="courseDep" + (i + 1)%>' onchange="
															if (courseDepSelected != 0) {
																document.getElementById('courseDiv' + <%=i + 1%> + ':' + courseDepSelected).style.display = 'none';
															}
															document.getElementById('courseDiv' + <%=i + 1%> + ':' + this.selectedIndex).style.display = 'inline';
															courseDepSelected = this.selectedIndex;
															document.getElementById('course' + <%=i + 1%> + ':' + this.selectedIndex).selectedIndex = 0;
															
															this.form.courseDep.value = this.value;
															this.form.courseID.value = document.getElementById('course' + <%=i + 1%> + ':' + this.selectedIndex).options[0].value;
														">
															<option value="All">All</option>
													<%
														for (int j = 0; j < preSearchData.getDepartNames().get(i).size(); j++) {
													%>
															<option value=<%=preSearchData.getDepartIDs().get(i).get(j) %> ><%=preSearchData.getDepartNames().get(i).get(j) %></option>
													<%
														}
													%>
														</select>
														</div>
													<%
													}
													%>
												</td>
											</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Course Name&nbsp;</td>
												<td align="left" valign="bottom" colspan="3">
													<%
													for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
														for (int j = 0; j < preSearchData.getDepartNames().get(i).size(); j++) {
														%>
															<div id='<%="courseDiv" + (i + 1) + ":" + (j + 1)%>' style='<%="position:relative; display:none" %>'>
															<select id='<%="course" + (i + 1) + ":" + (j + 1)%>' onchange="
																this.form.courseID.value = this.value;
															">
																<option value="All">All</option>
														<%
															for (int k = 0; k < preSearchData.getCourseNames().get(i).get(j).size(); k++) {
																%>
																<option value=<%=preSearchData.getCourseIDs().get(i).get(j).get(k) %> ><%=preSearchData.getCourseNames().get(i).get(j).get(k) %></option>
																<%
															}
																%>
															</select>
															</div>
													<%
														}
													}
													%>
												</td>
											</tr>
											
											<tr>
							  					<td align="left" valign="bottom" colspan="4"><em>&nbsp;Course Information&nbsp;</em></td>
							  				</tr>
							  				
							  				<tr>
												<td align="left" valign="bottom">&nbsp;Grade&nbsp;</td>
												<td align="left" valign="bottom" colspan="3">
													<select name="grade">
														<option value="All">All</option>
														<option value="Excellent">Excellent</option>
														<option value="Good">Good</option>
														<option value="Average">Average</option>
													</select>
												</td>
											</tr>
											
<!-------------------------------Project Information Part------------------------------------------------------------------------------------------------------------------------------->					
											
											<tr>
												<td align="left" valign="bottom">
													<input name="projectID" type="hidden" value="
							  							<%
							  							if (preSearchData.getProjectIDs().size() > 0) {
							  								if (preSearchData.getProjectIDs().get(0).size() > 0) {
							  									if (preSearchData.getProjectIDs().get(0).get(0).size() > 0) {
						  										%>
									  								<%=preSearchData.getProjectIDs().get(0).get(0).get(0) %>
									  							<%
							  									}
							  									else {
						  										%>
									  								<%=""%>
									  							<%
							  									}
							  								}
							  								else {
						  									%>
								  								<%=""%>
								  							<%
							  								}
							  							}
							  							else {
							  							%>
							  								<%=""%>
							  							<%
							  							}
							  							%>
							  						"/>
							  						&nbsp;Department/Institute Issued &nbsp;
							  						</td>
												<td align="left" valign="middle">
													<input type="hidden" name="projectDep" value="All" />
													<select name="projectCom" onchange="
														if (projectComSelected != 0) {
															document.getElementById('projectDepDiv' + projectComSelected).style.display = 'none';
															if (projectDepSelected != 0) {
																document.getElementById('projectDiv' + projectComSelected + ':' + projectDepSelected).style.display = 'none';
															}
														}
														
														projectComSelected = this.selectedIndex;
														projectDepSelected = 0;
														
														document.getElementById('projectDepDiv' + this.selectedIndex).style.display = 'inline';
														document.getElementById('projectDep' + this.selectedIndex).selectedIndex = 0;
														
														this.form.projectDep.value = 'All';
														
														document.getElementById('projectDiv' + this.selectedIndex + ':' + 0).style.display = 'inline';
														document.getElementById('project' + this.selectedIndex + ':' + 0).selectedIndex = 0;
														
														this.form.projectID.value = 'All';
													">
														<option value="All">All</option>
														<%
														for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
														%>
															<option value=<%=preSearchData.getCompanyIDs().get(i).intValue() %> ><%=preSearchData.getCompanyNames().get(i) %></option>
														<%
														}
														%>
													</select>
												</td>
												<td colspan="2" align="left" valign="middle">Department
													<%
													for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
													%>
														<div id='<%="projectDepDiv" + (i + 1) %>' style='<%="position:relative; display:none" %>'>
														<select id='<%="projectDep" + (i + 1) %>' onchange="
															if (projectDepSelected != 0) {
																document.getElementById('projectDiv' + <%=i + 1%> + ':' + projectDepSelected).style.display = 'none';
															}
															document.getElementById('projectDiv' + <%=i + 1%> + ':' + this.selectedIndex).style.display = 'inline';
															projectDepSelected = this.selectedIndex;
															document.getElementById('project' + <%=i + 1%> + ':' + this.selectedIndex).selectedIndex = 0;
															
															this.form.projectDep.value = this.value;
															this.form.projectID.value = document.getElementById('project' + <%=i + 1%> + ':' + this.selectedIndex).options[0].value;
														">
															<option value="All">All</option>
													<%
														for (int j = 0; j < preSearchData.getDepartNames().get(i).size(); j++) {
													%>
															<option value=<%=preSearchData.getDepartIDs().get(i).get(j) %> ><%=preSearchData.getDepartNames().get(i).get(j) %></option>
													<%
														}
													%>
														</select>
														</div>
													<%
													}
													%>
												</td>
											</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Project Name&nbsp;</td>
												<td align="left" valign="bottom" colspan="3">
													<%
													for (int i = 0; i < preSearchData.getCompanyNames().size(); i++) {
														for (int j = 0; j < preSearchData.getDepartNames().get(i).size(); j++) {
														%>
															<div id='<%="projectDiv" + (i + 1) + ":" + (j + 1)%>' style='<%="position:relative; display:none" %>'>
															<select id='<%="project" + (i + 1) + ":" + (j + 1)%>' onchange="
																this.form.projectID.value = this.value;
															">
																<option value="All">All</option>
														<%
															for (int k = 0; k < preSearchData.getProjectNames().get(i).get(j).size(); k++) {
																%>
																<option value=<%=preSearchData.getProjectIDs().get(i).get(j).get(k) %> ><%=preSearchData.getProjectNames().get(i).get(j).get(k) %></option>
																<%
															}
																%>
															</select>
															</div>
													<%
														}
													}
													%>
												</td>
											</tr>
							
<!-------------------------------Technology Information Part------------------------------------------------------------------------------------------------------------------------------->
											
											<tr>
							  					<td align="left" valign="bottom" colspan="4"><em>&nbsp;Technology Information&nbsp;</em></td>							  
						  					</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Language&nbsp;</td>
												<td align="left" valign="bottom">
													<input type="hidden" name="language" value="All" />
													<input type="hidden" name="langMOE" />
													<textarea name="txtLang" ></textarea>
												</td>
												<td align="left" valign="bottom">
													<select name="selectLang" onchange="
														if (this.value == 'All') {
															this.form.language.value = 'All';
															this.form.txtLang.value = '';
														}
													">
														<option value='All'>All</option>
													<%
													for (int i = 0; i < preSearchData.getLangNames().size(); i++) {
													%>
														<option value='<%=preSearchData.getLangIDs().get(i) %>'><%=preSearchData.getLangNames().get(i) %></option>
													<%
													}
													%>
													</select>
													Months of Experience 
													<input type="text" name="langExp" onchange="
														if (!isNumber(this.value)) {
															alert('Please input number in fields Months of experience');
														}
													"/>
												</td>
												<td align="left" valign="bottom">
													<input name="addLang" type="button" value="Add" onclick="
														if(this.form.selectLang.value!='All'){
															if(this.form.language.value=='' || this.form.language.value=='All'){
																this.form.language.value = this.form.selectLang.value;
																this.form.txtLang.value = this.form.selectLang.options[this.form.selectLang.selectedIndex].text;
																this.form.langMOE.value = this.form.langExp.value;
															}
															else if (!isIn(this.form.language.value, this.form.selectLang.value, ':')) {
																this.form.language.value += ':' + this.form.selectLang.value;
																this.form.txtLang.value += ', ' + this.form.selectLang.options[this.form.selectLang.selectedIndex].text;
																this.form.langMOE.value += ':' + this.form.langExp.value;
															}
														}
													"/>
												</td>
											</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Type of Application&nbsp;</td>
												<td align="left" valign="bottom">
													<input type="hidden" name="application" value="All" />
													<input type="hidden" name="appMOE" />
													<textarea name="txtApp" ></textarea>
												</td>
												<td align="left" valign="bottom">
													<select name="selectApp" onchange="
														if (this.value == 'All') {
															this.form.application.value = 'All';
															this.form.txtApp.value = '';
														}
													">
														<option value='All'>All</option>
													<%
													for (int i = 0; i < preSearchData.getAppNames().size(); i++) {
													%>
														<option value='<%=preSearchData.getAppIDs().get(i) %>'><%=preSearchData.getAppNames().get(i) %></option>
													<%
													}
													%>
														<option value='All'>All</option>
													</select>
													Months of Experience 
													<input type="text" name="appExp" onchange="
														if (!isNumber(this.value)) {
															alert('Please input number in fields Months of experience');
														}
													"/>
												</td>
												<td align="left" valign="bottom">
													<input name="addApp" type="button" value="Add" onclick="
														if(this.form.selectApp.value!='All'){
															if(this.form.application.value=='' || this.form.application.value=='All'){
																this.form.application.value = this.form.selectApp.value;
																this.form.txtApp.value = this.form.selectApp.options[this.form.selectApp.selectedIndex].text;
																this.form.appMOE.value = this.form.appExp.value;
															}
															else if (!isIn(this.form.application.value, this.form.selectApp.value, ':')) {
																this.form.application.value += ':' + this.form.selectApp.value;
																this.form.txtApp.value += ', ' + this.form.selectApp.options[this.form.selectApp.selectedIndex].text;
																this.form.appMOE.value += ':' + this.form.appExp.value;
															}
														}
													"/>
												</td>
											</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Kind of Technology&nbsp;</td>
												<td align="left" valign="bottom">
													<input type="hidden" name="technology" value="All" />
													<input type="hidden" name="techMOE" />
													<textarea name="txtTech" ></textarea>
												</td>
												<td align="left" valign="bottom">
													<select name="selectTech" onchange="
														if (this.value == 'All') {
															this.form.technology.value = 'All';
															this.form.txtTech.value = '';
														}
													">
														<option value='All'>All</option>
													<%
													for (int i = 0; i < preSearchData.getTechNames().size(); i++) {
													%>
														<option value='<%=preSearchData.getTechIDs().get(i) %>'><%=preSearchData.getTechNames().get(i) %></option>
													<%
													}
													%>
													</select>
													Months of Experience 
													<input type="text" name="techExp" onchange="
														if (!isNumber(this.value)) {
															alert('Please input number in fields Months of experience');
														}
													"/>
												</td>
												<td align="left" valign="bottom">
													<input name="addTech" type="button" value="Add" onclick="
														if(this.form.selectTech.value!='All'){
															if(this.form.technology.value=='' || this.form.technology.value=='All'){
																this.form.technology.value = this.form.selectTech.value;
																this.form.txtTech.value = this.form.selectTech.options[this.form.selectTech.selectedIndex].text;
																this.form.techMOE.value = this.form.techExp.value;
															}
															else if (!isIn(this.form.technology.value, this.form.selectTech.value, ':')) {
																this.form.technology.value += ':' + this.form.selectTech.value;
																this.form.txtTech.value += ', ' + this.form.selectTech.options[this.form.selectTech.selectedIndex].text;
																this.form.techMOE.value += ':' + this.form.techExp.value;
															}
														}
													"/>
												</td>
											</tr>
											
											<tr>
												<td align="left" valign="bottom">&nbsp;Kind of Framework&nbsp;</td>
												<td align="left" valign="bottom">
													<input type="hidden" name="framework" value="All" />
													<input type="hidden" name="frameMOE" />
													<textarea name="txtFrame" ></textarea>
												</td>
												<td align="left" valign="bottom">
													<select name="selectFrame" onchange="
														if (this.value == 'All') {
															this.form.framework.value = 'All';
															this.form.txtFrame.value = '';
														}
													">
														<option value='All'>All</option>
													<%
													for (int i = 0; i < preSearchData.getFrameNames().size(); i++) {
													%>
														<option value='<%=preSearchData.getFrameIDs().get(i) %>'><%=preSearchData.getFrameNames().get(i) %></option>
													<%
													}
													%>
													</select>
													Months of Experience 
													<input type="text" name="frameExp" onchange="
														if (!isNumber(this.value)) {
															alert('Please input number in fields Months of experience');
														}
													"/>
												</td>
												<td align="left" valign="bottom">
													<input name="addFrame" type="button" value="Add" onclick="
														if(this.form.selectFrame.value!='All'){
															if(this.form.framework.value=='' || this.form.framework.value=='All'){
																this.form.framework.value = this.form.selectFrame.value;
																this.form.txtFrame.value = this.form.selectFrame.options[this.form.selectFrame.selectedIndex].text;
																this.form.frameMOE.value = this.form.frameExp.value;
															}
															else if (!isIn(this.form.framework.value, this.form.selectFrame.value, ':')) {
																this.form.framework.value += ':' + this.form.selectFrame.value;
																this.form.txtFrame.value += ', ' + this.form.selectFrame.options[this.form.selectFrame.selectedIndex].text;
																this.form.frameMOE.value += ':' + this.form.frameExp.value;
															}
														}
													"/>
												</td>
											</tr>
											
											<tr align="left" valign="bottom">
												<td colspan="5">
													<input type="button" value="Search" onclick="
														if (MOEFieldsOK('<portlet:namespace />','searchForm')) {
															submitForm('<portlet:namespace />','searchForm','doSearch');
														}
														else {
															resetTechnology('<portlet:namespace />','searchForm');
															alert('Please input number in fields Months of experience');
														}
													"/>
													<input type="button" value="Reset" onclick="
														resetTechnology('<portlet:namespace />','searchForm');
														this.form.employeeName.value = '';
		
														this.form.companyID.selectedIndex = 0;
														if (comSelected != 0) {
															document.getElementById('depDiv' + comSelected).style.display='none';
														}
														this.form.departmentID.value = 'All';
														comSelected = 0;
														
														this.form.courseCom.selectedIndex = 0;
														if (courseComSelected != 0) {
															document.getElementById('courseDepDiv' + courseComSelected).style.display = 'none';
															if (courseDepSelected != 0) {
																document.getElementById('courseDiv' + courseComSelected + ':' + courseDepSelected).style.display = 'none';
															}
														}
														this.form.courseDep.value = 'All';
														this.form.courseID.value = 'All';
														courseComSelected = 0;
														courseDepSelected = 0;
														this.form.grade.selectedIndex = 0;
														
														this.form.projectCom.selectedIndex = 0;
														if (projectComSelected != 0) {
															document.getElementById('projectDepDiv' + projectComSelected).style.display = 'none';
															if (projectDepSelected != 0) {
																document.getElementById('projectDiv' + projectComSelected + ':' + projectDepSelected).style.display = 'none';
															}
														}
														this.form.projectDep.value = 'All';
														this.form.projectID.value = 'All';
														projectComSelected = 0;
														projectDepSelected = 0;
													"/>
												</td>
											</tr>
<!--------------------------------------Result Part --------------------------------------------------------------------------------->										 	
											<%
											List<EmployeeDTO> resultList = (List<EmployeeDTO>) session.getAttribute("resultList");
											if (resultList != null) {
											%>
											<tr>
												<td colspan="4"><h2 class="title">Result List</h2></td>
											</tr>
											
											<tr>
												<td colspan="4">
													<table border="1" width="100%">
														<tr>
															<td colspan="6" align="right"><em><%=resultList.size() %> result(s) found</em></td>
														</tr>
														<tr>
															<td align="center" valign="middle">&nbsp;Check&nbsp;</td>
															<td align="center" valign="middle">&nbsp;Name&nbsp;</td>
															<td align="center" valign="middle">&nbsp;Birthdate&nbsp;</td>
															<td align="center" valign="middle">&nbsp;Address&nbsp;</td>
															<td align="center" valign="middle">&nbsp;Email&nbsp;</td>
															<td align="center" valign="middle">&nbsp;Phone&nbsp;</td>								
														</tr>
														<%
														for (int i = 0; i < resultList.size(); i++) {
														%>
														<tr>
															<td align="center" valign="middle">
																<input type="checkbox" value='<%=resultList.get(i).getEmpID() %>' onclick="
																	if (isIn(this.form.exportEmpList.value, this.value, ':') && this.checked == false) {
																		this.form.exportEmpList.value = this.form.exportEmpList.value.replace(':' + this.value, '');
																		if (this.form.exportEmpList.value.length == 0) {
																			this.form.exportButton.style.visibility = 'hidden';
																		}
																	}
																	else if (!isIn(this.form.exportEmpList.value, this.value, ':') && this.checked == true) {
																		this.form.exportEmpList.value += ':' + this.value;
																		this.form.exportButton.style.visibility = 'visible';
																	}
																"/>
															</td>
															<td align="center" valign="middle">
																<a href=# onclick="
																	frm = getForm('<portlet:namespace />','searchForm');
																	frm.selectedSearchEmp.value = '<%=resultList.get(i).getEmpID() %>';
																	submitForm('<portlet:namespace />','searchForm','getEmpDetail');
																">
																	<%=resultList.get(i).getName() %>
																</a>
															</td>
															<td align="center" valign="middle"><%=resultList.get(i).getBirthday() %></td>
															<td align="center" valign="middle"><%=resultList.get(i).getAddress() %></td>
															<td align="center" valign="middle"><%=resultList.get(i).getEmail() %></td>
															<td align="center" valign="middle"><%=resultList.get(i).getPhone() %></td>								
														</tr>
														<%
														}
														if (resultList.size() > 0) {
														%>
														<tr>
															<td colspan="6"> 
																<input type="button" name="exportAllButton" value="Export All" onclick="
																	this.form.exportEmpList.value = '';
																	<%
																	for (int i = 0; i < resultList.size(); i++) {
																	%>
																		this.form.exportEmpList.value += ':' + '<%=resultList.get(i).getEmpID() %>';
																	<%
																	}
																	%>
																	this.form.exportEmpList.value = this.form.exportEmpList.value.substr(1);
																	submitForm('<portlet:namespace />','searchForm','export');
																"/>
																<input type="button" name="exportButton" value="Export" style="visibility:hidden" onclick="
																	this.form.exportEmpList.value = this.form.exportEmpList.value.substr(1);
																	submitForm('<portlet:namespace />','searchForm','export');
																"/>
															</td>
														</tr>
														<%
														}
														%>						
													</table>
												</td>
											</tr>
											<%
											}
											%>
										</table>
									</td>
								</tr>
							</table>			
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
</body>
</html>